package com.itheima.reggie.common;

//基于ThreadLocal 封装的工具类，用于保存和获取当前用户ID
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();
    public static void SetCurrentId(Long id){
        threadLocal.set(id);
    }
    public static Long GetCurrentId(){
        return threadLocal.get();
    }
    public static void RemoveCurrentId(){
        threadLocal.remove();
    }
}
